package collector;

import java.util.BitSet;

public class Matrix {
    private final int dimension;

    private final BitSet square_board;

    public Matrix(int dimension) {
        this.dimension = dimension;
        square_board = new BitSet(dimension * dimension);
        square_board.clear();
    }

    public void setTrueToCell(int x, int y) {//line:row; column:column
        square_board.flip(x * dimension + y);
    }

    public boolean getCellAt(int x, int y) {//line:row; column:column
        return square_board.get(x * dimension + y);
    }

    public int getDimension() {
        return dimension;
    }

    public void setFalseToCell(int x, int y) {
        square_board.flip(x * dimension + y);
    }
}
